<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>method_missing (dfcext.rb)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File dfcext.rb, line 99</span>
   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">sym</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
      <span class="ruby-identifier">possAtr</span> = <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">to_s</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;sym: #{possAtr}&quot;</span>
      <span class="ruby-identifier">puts</span> <span class="ruby-identifier">sym</span>.<span class="ruby-identifier">class</span>
      <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">args</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> )
         <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;args: #{args.to_s}&quot;</span>
         <span class="ruby-identifier">puts</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">class</span>
      <span class="ruby-keyword kw">end</span>
     
      <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hasAttr</span>(<span class="ruby-identifier">possAtr</span>))
         <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">isAttrRepeating</span>(<span class="ruby-identifier">possAtr</span>))
             <span class="ruby-comment cmt">#retreive the values as an Array</span>
             <span class="ruby-identifier">valueCount</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">getValueCount</span> <span class="ruby-identifier">possAtr</span>
             <span class="ruby-identifier">values</span> = []
             <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">num</span> <span class="ruby-keyword kw">in</span> (<span class="ruby-value">0</span><span class="ruby-operator">..</span>(<span class="ruby-identifier">valueCount</span> <span class="ruby-value">-1</span>))
                 <span class="ruby-comment cmt">#puts num</span>
                 <span class="ruby-identifier">x</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">&quot;getRepeating#{AttrTypeRef[self.getAttrDataType(possAtr)]}&quot;</span>, <span class="ruby-identifier">possAtr</span>, <span class="ruby-identifier">num</span>
                 <span class="ruby-identifier">values</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">x</span>
             <span class="ruby-keyword kw">end</span>
             <span class="ruby-identifier">values</span>
         <span class="ruby-keyword kw">else</span>
             <span class="ruby-comment cmt">#puts 'sending'</span>
             <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">&quot;get#{AttrTypeRef[self.getAttrDataType(possAtr)]}&quot;</span>, <span class="ruby-identifier">possAtr</span>
         <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">else</span>
         <span class="ruby-keyword kw">if</span> (<span class="ruby-regexp re">/.=$/</span>.<span class="ruby-identifier">match</span> <span class="ruby-identifier">possAtr</span>) <span class="ruby-keyword kw">then</span> <span class="ruby-comment cmt">#matches the string 'method_call='</span>
             <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;possible assignment method #{possAtr}&quot;</span>
             <span class="ruby-identifier">possAtr</span>.<span class="ruby-identifier">chop!</span>
             <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hasAttr</span>(<span class="ruby-identifier">possAtr</span>))
                <span class="ruby-keyword kw">if</span> (<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">isAttrRepeating</span>(<span class="ruby-identifier">possAtr</span>))
                   <span class="ruby-identifier">replaceRepeating</span>(<span class="ruby-identifier">possAtr</span>, <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>])
                <span class="ruby-keyword kw">else</span>
                   <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">&quot;set#{AttrTypeRef[self.getAttrDataType(possAtr)]}&quot;</span>, <span class="ruby-identifier">possAtr</span>, <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
                <span class="ruby-keyword kw">end</span>
             <span class="ruby-keyword kw">else</span>
                <span class="ruby-identifier">raise</span> <span class="ruby-constant">ScriptError</span>, <span class="ruby-value str">&quot;method missing or no such attribute to set&quot;</span>
             <span class="ruby-keyword kw">end</span>
         <span class="ruby-keyword kw">else</span>
            <span class="ruby-identifier">raise</span> <span class="ruby-constant">ScriptError</span>, <span class="ruby-value str">&quot;method missing or no such attribute&quot;</span>
         <span class="ruby-keyword kw">end</span>
      <span class="ruby-keyword kw">end</span>

   <span class="ruby-keyword kw">end</span></pre>
</body>
</html>